package com.shenhaofeng.rxcache.source;

import java.io.Serializable;

/**
 * Created by haofeng on 2016/9/25.
 */

public abstract class DiskSource<T> implements CacheSource<T> {


    @Override
    public T get(String key) {

        return readDataFromDisk(key);
    }


    @Override
    public boolean put(String key, T data) {
       return saveDataToDisk(key, data);
    }

    abstract boolean saveDataToDisk(String key, T data);

    abstract T readDataFromDisk(String key);


}
